package com.entity;

import com.alibaba.fastjson.JSONObject;
import com.util.VeDate;

// 订单表的实体类
public class Orders {
    private String ordersid = "O" + VeDate.getStringId(); // 生成主键编号
    private String ordercode; // 订单号
    private String usersid; // 用户
    private String goodsid; // 商品
    private String price; // 单价
    private String num; // 数量
    private String total; // 总计
    private String addtime; // 下单日期
    private String status; // 状态
    private String receiver; // 收货人
    private String address; // 送货地址
    private String contact; // 联系方式
    private String username; // 映射数据
    private String goodsname; // 映射数据
    private Users users;// 多对一映射类
    private Goods goods;// 多对一映射类
    private String sellerid;

    public String getSellerid() {
        return sellerid;
    }

    public void setSellerid(String sellerid) {
        this.sellerid = sellerid;
    }

    public String getOrdersid() {
        return this.ordersid;
    }

    public void setOrdersid(String ordersid) {
        this.ordersid = ordersid;
    }

    public String getOrdercode() {
        return this.ordercode;
    }

    public void setOrdercode(String ordercode) {
        this.ordercode = ordercode;
    }

    public String getUsersid() {
        return this.usersid;
    }

    public void setUsersid(String usersid) {
        this.usersid = usersid;
    }

    public String getGoodsid() {
        return this.goodsid;
    }

    public void setGoodsid(String goodsid) {
        this.goodsid = goodsid;
    }

    public String getPrice() {
        return this.price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getNum() {
        return this.num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getTotal() {
        return this.total;
    }

    public void setTotal(String total) {
        this.total = total;
    }

    public String getAddtime() {
        return this.addtime;
    }

    public void setAddtime(String addtime) {
        this.addtime = addtime;
    }

    public String getStatus() {
        return this.status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getReceiver() {
        return this.receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public String getAddress() {
        return this.address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getContact() {
        return this.contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public Users getUsers() {
        return this.users;
    }

    public void setUsers(Users users) {
        this.users = users;
    }

    public Goods getGoods() {
        return this.goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getGoodsname() {
        return this.goodsname;
    }

    public void setGoodsname(String goodsname) {
        this.goodsname = goodsname;
    }


    // 重载方法 生成JSON类型字符串
    @Override
    public String toString() {
        return this.toJsonString();
    }

    //直接转换成JSON字符串
    private String toJsonString() {
        JSONObject jsonString = new JSONObject();
        jsonString.put("ordersid", this.ordersid); // 主键编号
        jsonString.put("ordercode", this.ordercode); // 订单号
        jsonString.put("usersid", this.usersid); // 用户
        jsonString.put("goodsid", this.goodsid); // 商品
        jsonString.put("price", this.price); // 单价
        jsonString.put("num", this.num); // 数量
        jsonString.put("total", this.total); // 总计
        jsonString.put("addtime", this.addtime); // 下单日期
        jsonString.put("status", this.status); // 状态
        jsonString.put("receiver", this.receiver); // 收货人
        jsonString.put("address", this.address); // 送货地址
        jsonString.put("contact", this.contact); // 联系方式
        jsonString.put("Users", this.users); // 多对一映射类
        jsonString.put("Goods", this.goods); // 多对一映射类
        jsonString.put("username", this.username); // 映射数据
        jsonString.put("goodsname", this.goodsname); // 映射数据
        return jsonString.toString();
    }


    //作者联系 QQ 1420527913   毕设成品下载网址  codebag.cn
}




